/**
 * NJS HTTP Server
 *
 * $Id: http.js 6 2011-07-12 08:32:51Z leizongmin@gmail.com $
 * @author 老雷 <leizongmin@gmail.com>
 * @version 0.22
 * @date 2011-07-12 16:27:58
 */
 
process.env.DEBUG = 'debug';

var http	= require('http'),
	fs		= require('fs'),
	logger	= require('./lib/logger'),
	njs		= require('./lib/njs'),
	config	= require('./lib/config');
	
	
// 配置虚拟主机
config.set('default', 'path', '/app/lx-njs/www');
config.set('local.laifenxiang.net', 'path', '/app/lx-njs/www/vhost');


// 绑定到httpServer实例
var server = http.createServer();
	server.listen(81);
server.on('request', njs.request);

process.on('uncaughtException', function (err) {
	logger.log(err, 'error');
});



logger.log('NJS Server is runing...');
